package com.beerq.view;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.webkit.WebView;

import com.beerq.util.Constants;


public class SplashActivity extends Activity {


    private static final int MSG_DATA_DELAY=0x2345;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        WebView webView=new WebView(this);
        webView.loadUrl(Constants.domain+"#/recommend");


    }

    @Override
    protected void onResume() {
        super.onResume();

        handler.sendEmptyMessageDelayed(MSG_DATA_DELAY, 1200);

    }

    private void work(){
        Intent intent = new Intent(SplashActivity.this, MainActivity.class);
        startActivity(intent);
        finish();
    }

    Handler handler=new Handler(new Handler.Callback() {
        @Override
        public boolean handleMessage(Message msg) {
            // TODO Auto-generated method stub
            if(msg.what==MSG_DATA_DELAY){
                work();
            }
            return false;
        }
    });
}
